Update Work Order
Introduction
The Assetic REST API endpoint PUT /api/v2/workorder/{id} is used to update a work order. {id} is the unique GUID of the Work Order that is to be updated.
The article Create Work Order provides detailed information about the various fields in the work order object. Use this is the reference when looking to change fields (other than free text or numeric fields) via the PUT endpoint.
Updating fields in work order
The following steps should be followed:
- Retrieve the work order using the Assetic REST endpoint GET /api/v2/workorder/{id} which ensures the required fields for the PUT payloads are in the response. Refer to article Get Work Order
- Modify the response object to set new values for the keys (fields) that require updating.
- Apply the update using the modified response object as the payload for the PUT.
Supporting Information Comments
An exception to this process is the "Supporting Information" object which is a list object. New comments may be added by appending to this list, but existing comments cannot be modified.
You can add another comment to the "Supporting Information" by including a new SupportingInformation object in the SupportingInformation key
"SupportingInformation": [{"Description": "Patch as required additional"}]
If there are no additional comments to add then the SupportingInformation object may be left as is from the GET response, or set to null.
Linked Work Requests
Work Requests that are approved may be linked to the work order using the GUID of the work request. Including the following sample in the payload will link 2 work requests to the work order.
"LinkedWorkRequests": [
{
"ID": "f5650456-3248-4d46-8920-a7b1281c8028"
},
{
"ID": "9564cdc8-067e-406d-bc14-556759e60f5c"
}]
Workflow changes
It is possible to change the status of a work order provided the validation rules for moving from one status to the next are followed.